<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title> 
    <style type="text/css">
*{margin: 0;padding: 0;}
#div{width: 100px;height: 100px;background: black;position: absolute;}

    </style>
</head>
<body>
asdajdkladlkakk
<div id='div'></div>
<script type="text/javascript">
	


	div.onmousedown = function(e){
		var ev = e || event;
		var l = ev.clientX - div.offsetLeft;
		var t = ev.clientY - div.offsetTop;
		document.onmousemove = function(e){
			var ev = e || event;
			div.style.left = ev.clientX-l + 'px';
			div.style.top = ev.clientY-t + 'px';
			
			//
			/*document.body.innerHTML = ev.clientX + ','+ev.clientY;
			*/
		};
		document.onmouseup = function(){
			document.onmousemove = null;
			document.onmouseup = null;

		}
		return false;
		

	}

	
	//window.window.window.
</script>
</body>
</html>